<template>
  <div>
    <el-table :data="tableData">
      <el-table-column label="姓名" prop="username"></el-table-column>
      <el-table-column label="性别" prop="sex"></el-table-column>
      <el-table-column label="地址" prop="address"></el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    name: 'index',
    data() {
      return {
        tableData: []
      };
    },
    methods: {
      getUserList() {
        this.$api.request({
          path: 'admin/user/getList',
          method: 'get'
        })
          .then(({ data }) => {
            this.tableData = data;
          });
      }
    },
    mounted() {
      this.getUserList();
    }
  };
</script>

<style scoped>

</style>
